package com.smart.seckilldemo.rocketmq.consumer;


import com.smart.seckilldemo.utils.RedisJudgeUtils;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * 接收缓存删除任务
 */
@Component
@Slf4j
@RocketMQMessageListener(topic = "tp_delete_cache",consumerGroup = "consumer_grp_03")
public class DeleteCachePConsumer implements RocketMQListener<String> {

    @Resource
    RedisJudgeUtils redisJudgeUtils;

    @Override
    public void onMessage(String msg) {
        //删除缓存
        redisJudgeUtils.deleteRed(msg);
    }
}
